package bridge

import (
	"fmt"
	"strings"
)

type DataRow struct {
	FieldList []*DataField
}

func NewMockDataRow() *DataRow {
	it := &DataRow{
		make([]*DataField, 0),
	}
	it.FieldList = append(it.FieldList, NewMockDataField("int-1", DATA_TYPE_INT))
	it.FieldList = append(it.FieldList, NewMockDataField("float-1", DATA_TYPE_FLOAT))
	it.FieldList = append(it.FieldList, NewMockDataField("string-1", DATA_TYPE_STRING))
	return it
}

func (me *DataRow) FieldsString() string {
	lst := make([]string, 0)
	for _,f := range me.FieldList {
		lst = append(lst, fmt.Sprintf("%s=%s", f.Name, f.ValueString()))
	}
	return strings.Join(lst, ", ")
}